#!/usr/bin/env bash

if [ $# -gt 0 ];then
    server_ip=$1
else
    server_ip=10.125.52.132
fi

cd ${HOME}/testbed
PIDS=`ps aux | grep "python utest.py" | grep "client" | awk '{ print $2 }'`
if [ "${PIDS}" != "" ]; then
    kill ${PIDS}
    sleep 1
fi
if [ -f /tmp/.testbed_client ]; then
    rm -rf /tmp/.testbed_client
fi
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi
screen -dmL python utest.py client -s ${server_ip}
